import Service from "./Service";
import style from "./style.module.css";
import OmitLine from "@/components/OmitLine/OmitLine";
import { Link } from "react-router-dom";
export default class AnnouncementInfo extends Service{

    render = () => {
        let {isActive}=this.state;
        const {noticeList,policyFileList}=this.props;
        return (
        <div className={style.AnnouncementInfo}>
            <div className={style.tabs_bar}>
                <div onClick={()=>this.setState({
                    isActive:true
                })} style={{
                    color:`${isActive ? "#398DF9" : "#585858"}`
                }} className={style.item}>
                    通知公告    
                </div>
                <span>|</span>
                <div onClick={()=>this.setState({
                    isActive:false
                })} style={{
                    color:`${!isActive ? "#398DF9" : "#585858"}`
                }} className={style.item}>
                    政策文件
                </div>
                <Link to={"/announcement_list"} className={style.more}>
                    更多 {">"}
                </Link>
            </div>
            <div className={style.tabs_content}>
                <div className={style.list}>
                    {
                        (isActive ? noticeList : policyFileList).map((item,index)=><OmitLine key={index} data={item} />)
                    }
                </div>
            </div>
        </div>
        )
    }
}